package org.jeecg.modules.workflow.service.change.listener;

import org.jeecg.modules.workflow.framework.core.event.BpmProcessInstanceResultEvent;
import org.jeecg.modules.workflow.framework.core.event.BpmProcessInstanceResultEventListener;
import org.jeecg.modules.workflow.service.change.BpmChgSnorgService;
import org.jeecg.modules.workflow.service.change.imp.BpmChgSnorgServiceImpl;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author : Wzz
 * @create : 2023-04- 26- 14:48
 * @desc :变更申请 签约机构变更 的结果的监听器实现类
 */
@Component
public class BpmChgSnorgResultListener extends BpmProcessInstanceResultEventListener {

    @Resource
    private BpmChgSnorgService chgSnorgService;

    @Override
    protected String getProcessDefinitionKey() {
        return BpmChgSnorgServiceImpl.PROCESS_KEY;
    }

    @Override
    protected void onEvent(BpmProcessInstanceResultEvent event) {
        chgSnorgService.updateChgSnorgResult(event.getBusinessKey(), event.getResult());
    }
}
